<div class="panel-default">
  <table lay-filter="demo" lay-size='lg'>
    <thead>
      <tr>

        <th lay-data="{field:'name'}"><%= Carousel.human_attribute_name(:name) %></th>

        <th lay-data="{field:'img'}"><%= Carousel.human_attribute_name(:img) %></th>

        <th lay-data="{field:'jump_link'}"><%= Carousel.human_attribute_name(:jump_link) %></th>

        <th lay-data="{field:'operation',width:200}"></th>
      </tr>
    </thead>

    <tbody>
      <% @carousels.each do |carousel| %>
        <tr>

          <td><%= carousel.name %></td>

          <td><%= image_tag carousel.img_url, size: '30x30' rescue '' %></td>

          <td><%= carousel.jump_link %></td>

          <td>
            <%= link_to edit_admin_carousel_path(carousel), remote: true, class: "label" do -%><i class="iconfont icon-bianji"></i>编辑<% end %>
            <%= link_to [:admin, carousel], method: :delete, data: { confirm: '确定删除吗? 注意此操作无法撤销！' }, class: "label label-danger" do -%><i class="iconfont icon-shanchu"></i>删除<% end %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
  <%= link_to new_admin_carousel_path, remote: true do -%><button type="button" class="layui-btn"><i class="layui-icon">&#xe608;</i> <%= t('actions.new') + Carousel.model_name.human %></button><% end %>
</div>

<div id="add_carousel" style="display: none; padding: 20px"></div>
<!-- 放大图片 -->
<div class='elastic_show' hidden>
  <!-- 黑影 -->
  <div class="mask" hidden></div>
  <%= image_tag ''%>
</div>
